﻿package plugin.specialActivity.game
{
    import com.core.*;
    import manager.*;
    import morn.core.handlers.*;
    import plugin.specialActivity.*;
    import uiresource.specialActivity.*;

    public class BossRewardGame extends BossRewardUI implements IPage
    {
        private var _pageMsg:Object;

        public function BossRewardGame(param1:Object)
        {
            this._pageMsg = param1;
            this.initEvent();
            return;
        }// end function

        private function initEvent() : void
        {
            btn_qianwang.clickHandler = new Handler(this.toBoss);
            return;
        }// end function

        private function toBoss() : void
        {
            if (UserData.getUserData("level") >= 49)
            {
                ModelProxy.change("plugin", "open", {target:"bossChallenge", data:2});
            }
            else
            {
                WarningManager.show(38, [49]);
            }
            return;
        }// end function

        public function refresh() : void
        {
            var _loc_1:* = UserData.getOnlineData("instanceresetcost");
            txt_reward.text = "次日可返还元宝数：" + _loc_1;
            return;
        }// end function

        public function update(param1:int, param2:Object) : void
        {
            switch(param1)
            {
                case ActivityPublic.UPDATETIME:
                {
                    txt_countdown.text = String(param2);
                    break;
                }
                case ActivityPublic.UPDATEBOSSREWARD:
                {
                    txt_reward.text = "次日可返还元宝数：" + param2;
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }// end function

    }
}
